package com.junko.service.back.impl;

import com.junko.core.base.BaseServiceImpl;
import com.junko.dao.back.AdminDao;
import com.junko.model.back.Admin;
import com.junko.service.back.IAdminService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminService extends BaseServiceImpl<Admin> implements IAdminService {
    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin findByAccount(String account) {
        if(StringUtils.isEmpty(account)){
            return null;
        }
        return adminDao.findByAccount(account);
    }

    @Override
    public Admin findByNickname(String nickname) {
        if(StringUtils.isEmpty(nickname)){
            return null;
        }
        return adminDao.findByNickname(nickname);
    }
}